<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<script type="text/javascript" src="<%=path %>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="<%=path %>/js/layer/layer.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="<%=path %>/js/common.js"></script>
<script type="text/javascript" src="<%=path %>/js/nfpDrag.js"></script>
<script type="text/javascript" src="<%=path %>/js/blackbox/js/jquery.blackbox.js"></script>
<script type="text/javascript" src="<%=path %>/js/toastr/toastr.js"></script>
<script type="text/javascript" src="<%=path %>/js/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="<%=path %>/js/blackbox/css/blackbox.css" type="text/css" />
<link rel="stylesheet" href="<%=path %>/js/toastr/toastr.css" type="text/css" />
<link rel="stylesheet" href="<%=path %>/js/bootstrap/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="<%=path %>/js/layer/skin/layer.css" type="text/css"></link>
<link rel="stylesheet" href="<%=path %>/js/layer/skin/layer.ext.css" type="text/css"></link>
<link rel="stylesheet" href="<%=path %>/main.css" type="text/css" />
<link rel="stylesheet" href="<%=path %>/css/style.css" type="text/css" />
<script type="text/javascript">
	var totalPath="<%=path %>";
	//声明xbox对象
	var xbox=new BlackBox();	
	function logout(){
		window.location="<%=path%>/logout/logoutAction.action";
	}
	
	function createTab(title,menuUrl){
		if ($("#right_tabs").tabs('exists', title)){ 
         	$("#right_tabs").tabs('select', title);
	     } else {
		   	/**添加一个tab标签**/
		    $("#right_tabs").tabs('add',{
		    	title: title,
		    	selected: true,
		    	content:'<iframe scrolling="auto"  frameborder="0" class="right_frame"  src="'+menuUrl+'" ></iframe>',
		    	closable:true
		   	});
		   	var widthVal=$(document.body).width()*0.85;
    		var heightVal=$(document.body).height()-50;
			$("#right_tabs,.tabs-panels").css("width",widthVal).css("height",heightVal);
			$(".right_frame").css("width",widthVal).css("height",heightVal-20);
			//实时更新历史操作信息
			var historyMenuList = $("#historyMenuList");
			var historyMenuLists = historyMenuList.children();
			if(historyMenuLists.filter("[source='"+title+"']:first").size()==0){
				if(historyMenuLists.size()>=10)
					$(historyMenuLists[0]).remove();
				historyMenuList.append('<a style="font-size:12px; color:#999;" source="'+title+'" onclick="createTab(\''+title+'\',\''+menuUrl+'\');" href="javascript:void(0);">&lt;'+title+'&gt;</a>');
			}
	     }
	}
		
	function changePassword(){
		openModelWindow("修改密码","<%=path%>/user/user_toAdd_changepwdAction.action",400,240);	
	}
	
	function openAppsBox(){
		var widthVal=800;
		var heightVal=600;
		$.layer({
		    type : 2,
		    title : '快捷菜单',
		    iframe : {src : "<%=path%>/menu/menu_queryApps_appsAction.action"},
		    area : [widthVal , heightVal],
		    offset : ['20px',''],
		    end : function(){
		    	$("#refreshForm").submit();
		    }
		});
	}
	function closeSearchBox(){
		$(".xubox_close").click();
	}
	function openModelWindow(title,url,width,height){
		var widthVal=width ? width : $(document.body).width()-100;
		var heightVal=height ? height : $(document.body).height()-150;
		$.layer({
		    type : 2,
		    title : title,
		    iframe : {src : url},
		    area : [widthVal , heightVal],
		    offset : ['20px',''],
		    end : function(){
		    }
		});
	}
	//通用TIP提示方法
	function j_tip(message,type){
		if(type== undefined || type==null){
			toastr.info(message);
		}else if(type=="error"){
			toastr.error(message);
		}else if(type=="success"){
			toastr.success(message);
		}else if(type=="warning"){
			toastr.warning(message);
		}else{
			toastr.info(message);
		}
	}

</script>